home *** CD-ROM | disk | FTP | other *** search
- /* Example sound player. It reads the command from ENV:RODreamSound and
- adds the sample to play at the end of the string, so the variable in
- ENV: sould be for example 'run >nil: c:xplay nfl sounds=' (without
- quotas of course). This isn't a proper way to play samples with ReqAttack,
- but I understand that RASoundDeamon which uses datatypes isn't very
- good either.
-
- Program suggested by BKJ (Vulture@freemail.gr).
-
- IMPORTANT: To protect ReqOFF againts going into infinitive loop (when your
- requester replacer calls EasyRequestArgs() with same TITLE and/or TEXT
- as the original requester) you should add a single space as a first byte
- of title string, or simply change it to other title which will not qualify
- to be patched by your program again and again and again...
-
- IMPORTANT: the easystruct you receive as 0x12345678 (the last argument)
- contains the bodytext preprocessed by RawDoFmt. If you wan't to filter
- the requester you should exit with 127 (ENDPROC REQATTACK_DISPLAYREQ/
- RETURN REQATTACK_DISPLAYREQ). This will cause the requester to open as
- a normal requester (not ReqOFF'ed).
- */
-
- MODULE 'dos/dos','intuition/intuition','jaca/replacer'
-
- DEF pos
- DEF fh,file[1501]:STRING,fib[260]:ARRAY OF CHAR,fibl:PTR TO fileinfoblock
- DEF file2[1001]:STRING,re:PTR TO replacerdata
-
- PROC main()
- IF fh:=Open('ENV:RODreamSound.prefs',MODE_OLDFILE)
- ExamineFH(fh,fib);fibl:=fib -> read the command to execute...
- Read(fh,file,fibl.size)
- file[fibl.size+1]:=NIL
- Close(fh)
-
- IF StrCmp(arg,'"',1) -> the 1st arg is sample name
- pos:=InStr(arg,'"',1) -> which has to be specified in
- StrCopy(file2,arg,pos) -> RAPrefsMUI
- ELSE
- pos:=InStr(arg,' ',1)
- StrCopy(file2,arg,pos) -> now the file variable contains
- ENDIF -> the file name
-
- StringF(file,'\s \s',file,file2)
- ENDIF
-
- pos:=InStr(arg,'0x',0) -> replace all 0x with ' $'
- arg[pos]:=$20;arg[pos+1]:=$24 -> Val() needs hexadecimal numbers...
- re:=Val(arg+pos,0) -> (get the value)
- -> ...to be preceded by '$'
-
- -> run the command...
- SystemTagList(file,NIL)
- ENDPROC REQATTACK_DISPLAYREQ ->let ReqAttack open the original requester...
-